package cn.com.starbucks.activity.manager;

import cn.com.starbucks.activity.entity.Test;
import cn.com.starbucks.activity.mapper.TestMapper;
import org.springframework.data.redis.core.RedisTemplate;

/**
 * Description:
 *
 * @author tecsmile@outlook.com
 * @version 1.0
 * @date 2021/4/14 5:30 下午
 **/
public class TestManager  {

    private TestMapper testMapper;
    private RedisTemplate<String, Object> redisTemplate;

    public TestManager(TestMapper testMapper, RedisTemplate<String, Object> redisTemplate) {
        this.testMapper = testMapper;
        this.redisTemplate = redisTemplate;
    }

    public Test getById(Long id) {
        return testMapper.selectById(id);
    }

    public String getRedisVal(String key) {
        return redisTemplate.opsForValue().get(key).toString();
    }
}
